package com.yonyou.cyxdms.sysAuth.service.constants;

public enum BrokerNameEnum {

    /**
     * // 自己约定消息类型在自定义字段中
     *
     * @author: wangsc
     * @since: 2018/9/13
     * @updateDate:
     * @updateRemark:
     * @version:1.0 Copyright: Copyright (c) 2018
     */
    SalesCounsultant(1, "销售顾问"),
    SalsManager(2, "销售经理"),
    MarkingSpecialist(3, "市场专员"),
    MarkingManager(4, "市场经理"),
    GeneralManager(5, "店总经理"),
    OnLineChat(6, "在线客服");
    private int key;
    private String value;

    BrokerNameEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public static BrokerNameEnum getByKey(int key) {
        for (BrokerNameEnum dot : BrokerNameEnum.values()) {
            if (key == dot.getKey()) {
                return dot;
            }
        }
        return null;
    }

    public static BrokerNameEnum getByValue(String value) {
        for (BrokerNameEnum dot : BrokerNameEnum.values()) {
            if (value.equals(dot.getValue())) {
                return dot;
            }
        }
        return null;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}


